﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BA2009.Entities;
using System.Web.Mvc;

namespace BA2009.Tests.Fakes
{
    public class FakeBA2009Data
    {
        public static IList<Page> CreateTestPages()
        {
            List<Page> pages = new List<Page>();

            for (int i = 0; i < 10; i++)
            {
                Page page = new Page 
                { 
                    PageID=i,
                    Code="Code"+i.ToString(),
                    Description="Desc"+i.ToString(),
                    INDEX=i,
                    PageName="PageName"+i.ToString()
                };
                pages.Add(page);
            }

            return pages;
        }

        public static IList<Banner> CreateTestBanners()
        {
            IList<Banner> banners = new List<Banner>();

            for (int i = 0; i < 10; i++)
            {
                Banner banner = new Banner
                {
                    BannerID = i,
                    BannerName = "BannerName" + i.ToString(),
                    BannerTypeID = 1,
                    Code = "CODE" + i.ToString()

                };
                banners.Add(banner);
            }

            return banners;
        }

        public static Banner CreateBanner()
        {
            Banner banner = new Banner
            {
                BannerID = 1,
                BannerName = "BannerName",
                BannerTypeID = 1,
                Code = "CODE"
            };

            return banner;
        }

        public static Page CreatePage()
        {
            Page page = new Page
            {
                PageID = 1,
                Code = "PAGECODE",
                Description = "Test Page Description",
                INDEX = 1,
                PageName = "Page Name"
            };

            return page;    
        }

        public static FormCollection CreatePageFormCollection()
        {
            var form = new FormCollection();

            form.Add("PageID", "PageID");
            form.Add("Code", "PAGECODE");
            form.Add("Description", "Test Page Description");
            form.Add("PageName","Page Name");

            return form;
        }

        public static FormCollection CreateBannerFormCollection()
        {
            var form = new FormCollection();
            form.Add("Code", "fake code");
            form.Add("BannerName", "fake banner name");
            form.Add("BannerTypeID","1");
            form.Add("chkResourceID_1","on");
            form.Add("chkResourceID_3","on");
            form.Add("chkResourceID_5","on");

            return form;
        }
    }
}
